﻿function GetData(data) {
    $(":input", document.forms[0]).each(function () {
        var fieldName = this.name;
        var prefix = fieldName.substr(0,3);
        if (prefix == "txt") { 
            $("[name='"+fieldName+"']").val(data[fieldName.substr(3)]);
        }
    });
    $(":radio", document.forms[0]).each(function () {
        var fieldName = this.name;
        var prefix = fieldName.substr(0,3);
        if (prefix == "rbl") { 
            $("[name='"+fieldName+"']").val([data[fieldName.substr(3)]]);
        }
    });
    $("select", document.forms[0]).each(function () {
        var fieldName = this.name;
        var prefix = fieldName.substr(0, 3);
        if (prefix == "ddl") {
            $("[name='" + fieldName + "']").val([data[fieldName.substr(3)]]);
        }
    });
}
function request(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
}